<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">

        <div @click="divClick">
            <!-- 阻止向上冒泡 -->
            <button @click.stop="btnClick">按钮</button>
        </div>
        <!-- 按回车输入内容 -->
        <input type="text" @keyup.enter="keyupEnter" />
    </div>
    <!-- 引入vue.js -->
    <script src="../../js/vue.js"></script>

    <!-- 代码逻辑 -->
    <script>
        const dcl = {
            data() {
                return {
                    counter: 100
                }
            },
            methods: {
                divClick() {
                    console.log('点击了divBtn')
                },
                btnClick() {
                    console.log('点击了btnClick')
                },
                keyupEnter(event) {
                    console.log('keyUp', event.target.value)
                }

            }
        }
        Vue.createApp(dcl).mount('#app');
    </script>
</body>

</html>